Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pseudo-inverse of tensors and enable tranpose for Vec{dim} #139

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

yijiangh
Copy link

Summary

  1. Enable tranpose for first-order tensor
  2. Add pseudo-inverse for Vec{dim}, Tensor{2,dim}, SymmetricTensor{2, dim}, Tensor{4, dim}, SymmetricTensor{4, dim, T}.
  • In the Vec{dim} case, pinv produces Transpose{T, Vec{dim, T}}(t / norm(t))
  • In the last four cases, pinv is reduced to inv.

One example use case for pinv of tensors is the elastic simulation of 3D trusses. In a truss element, the reference domain \xi is 1D and the nodal coordinate x is in 3D. Here, dx/d\xi is not a square matrix so it's not invertible. Then, pinv needs to be used.

What type of change is this?

  • Bug fix in a backwards-compatible manner.
  • New feature in a backwards-compatible manner.
  • Breaking change: bug fix or new feature that involve incompatible API changes.
  • Other (e.g. doc update, configuration, etc)

Checklist

  • I ran all tests on my computer and it's all green (i.e. ] test).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if appropriate)

@codecov-commenter
Copy link

codecov-commenter commented Sep 30, 2020

Codecov Report

Merging #139 into master will decrease coverage by 0.84%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #139      +/-   ##
==========================================
- Coverage   95.77%   94.93%   -0.85%     
==========================================
  Files          16       16              
  Lines        1135     1144       +9     
==========================================
- Hits         1087     1086       -1     
- Misses         48       58      +10     
Impacted Files Coverage Δ
src/Tensors.jl 82.05% <ø> (ø)
src/math_ops.jl 88.23% <0.00%> (-9.60%) ⬇️
src/tensor_ops_errors.jl 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2af6821...1ce9e58. Read the comment docs.

@codecov-io
Copy link

codecov-io commented Oct 21, 2020

Codecov Report

Merging #139 into master will decrease coverage by 0.84%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #139      +/-   ##
==========================================
- Coverage   95.77%   94.93%   -0.85%     
==========================================
  Files          16       16              
  Lines        1135     1144       +9     
==========================================
- Hits         1087     1086       -1     
- Misses         48       58      +10     
Impacted Files Coverage Δ
src/Tensors.jl 82.05% <ø> (ø)
src/math_ops.jl 88.23% <0.00%> (-9.60%) ⬇️
src/tensor_ops_errors.jl 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2af6821...263b064. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants